# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=libdjinterop
pkgver=0.20.2 # This needs to be the exact version testing/mixxx expects
pkgrel=1
pkgdesc="C++ library for access to DJ record libraries"
url="https://github.com/xsco/libdjinterop"
arch="all"
license="LGPL-3.0-only"
depends_dev="
	sqlite-dev
	zlib-dev
	"
makedepends="$depends_dev
	cmake
	samurai
	"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/xsco/libdjinterop/archive/refs/tags/$pkgver.tar.gz
	0001-Fix-build.patch
	"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
591cbf8102e16b11337ec25ad90ef035bf65dbbd18591802d959044874f36bb61bce3d5db974b00ecee14b45c7ea2488542b226d823d9087c92a0b452d804ff3  libdjinterop-0.20.2.tar.gz
092aee79d8ef027d5011bee71af759706ea09f567897fd34a96aa147c418693398b720689e0e2047fa484d33db8bfdc8c41481567b6ac8d1b397d69ddf1add0e  0001-Fix-build.patch
"
